package com.hzlj.position.locate.controller;


import com.fz.common.base.dto.PageParamDTO;
import com.fz.common.base.dto.QueryPageResultDTO;
import com.fz.common.base.dto.ResultDTO;
import com.hzlj.position.locate.common.dto.abnNightOut.AbnNightOutListDTO;
import com.hzlj.position.locate.common.dto.abnNightOut.AbnNightOutQueryParamDTO;
import com.hzlj.position.locate.common.dto.abnNightOutJzry.AbnNightOutJzryQueryResultDTO;
import com.hzlj.position.locate.service.AbnNightOutJzryService;
import com.hzlj.position.locate.service.AbnNightOutService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 【定位分析-夜不归宿表】接口
 *
 * @author lifh
 * @date 2023-03-28 10:20:27
 */
@Slf4j
@RestController
@RequestMapping("/position/abn/night/out")
public class AbnNightOutController {

    @Resource
    private AbnNightOutService abnNightOutService;
    @Resource
    private AbnNightOutJzryService abnNightOutJzryService;

    /**
     * 位置列表 定位分析-夜不归宿表
     */
    @GetMapping("/positions/{id}")
    public ResultDTO<List<AbnNightOutJzryQueryResultDTO>> getPositions(@PathVariable("id") String id) {
        log.info("【查询信息】定位分析-夜不归宿表:id={}", id);
        return new ResultDTO<>(abnNightOutJzryService.listAbnNightOutJzry(id));
    }


    /**
     * 分页查询 定位分析-夜不归宿表
     */
    @GetMapping("/list/page")
    public ResultDTO<QueryPageResultDTO<AbnNightOutListDTO>> pageAbnNightOut(AbnNightOutQueryParamDTO dto, PageParamDTO pageParamDTO) {
        log.info("【查询分页列表】信息定位分析-夜不归宿表,AbnNightOutQueryParamDTO={},pageParamDTO={}", dto, pageParamDTO);
        return new ResultDTO<>(abnNightOutService.pageAbnNightOut(dto, pageParamDTO));
    }

}

